/*
** main.c for  in /home/lund/Projets/lemipc
** 
** Made by florian dewulf
** Login   <dewulf_f@epitech.net>
** 
** Started on  Tue Mar 26 20:47:29 2013 florian dewulf
** Last update Tue Mar 26 22:16:01 2013 florian dewulf
*/

#include	<stdio.h>
#include	"lemipc.h"

int		main(int ac, char **av)
{
  char		key;
  int		limit;

  if (ac != 3)
    return (write(2, USAGE, USAGE_SIZE));
  key = atoi(av[1]);
  limit = atoi(av[2]);
  if ((av[1][0] < '0' || av[1][0] > '9') || (key != SERVER && key != CLIENT))
    return (write(2, ARG1, ARG1_SIZE));
  else if (key == SERVER && limit <= 1)
    return (write(2, ARG2_S, ARG2_S_SIZE));
  else if (key == CLIENT && limit < 10)
    return (write(2, ARG2_C, ARG2_C_SIZE));
  else if (key == SERVEUR)
    server(limit);
  else
    client(limit);
  return (0);
}
